﻿<!--{include file="admht/_meta.html"}-->
<!--{include file="admht/_header.html"}-->
<!--{include file="admht/_menu.html"}-->


<section class="Hui-article-box">
	<nav class="breadcrumb"><i class="Hui-iconfont"></i> <a href="/admht.php" class="maincolor">首页</a> 
		<!--{$com.crumb}-->
		<a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a>
	</nav>
	<div class="Hui-article">
		<article class="cl pd-20">
		<!--{if $op =='list'}-->
			<div class="codeView docs-example">
				<div class="row cl">
					<div class="col-xs-6 col-sm-2">
						<select class="select" size="1" name="demo1">
							<option value="" selected>--选择所属板块--</option>
							<!--{foreach from=$column_list item=v}-->
							<option value="<!--{$v.id}-->"><!--{$v.name}--></option>
							<!--{/foreach}-->
						</select>
					</div>
					<div class="col-xs-6 col-sm-2">
						<input class="btn btn-primary radius" type="button" value="新 增" onclick="window.location.href='/admht.php?tp=news&op=show_add'">
					</div>
				</div>
				<p><br/></p>
				<table class="table table-border table-bordered table-striped table-hover">
					<thead>
						<tr>
							<th>ID</th>
							<th>标题</th><th>标题</th><th>标题</th>
							<th>所属板块</th>
							<th>封面</th>
							<th>首页</th>
							<th>排序</th>
							<th>阅读总数</th>
							<th>评论总数</th>
							<th>编辑人</th>
							<th>审核状态</th>
							<th>添加时间</th>
							<th>操作</th>
						</tr>
					</thead>
					<tbody>
						<!--{foreach from=$list item=val}-->
						<tr>
							<td><!--{$val.id}--></td>
							<td><!--{$val.title}--></td><td><!--{$val.title}--></td><td><!--{$val.title}--></td>
							<td><!--{$show_list[$val.news_sort]}--></td>
							<td><!--{if $val.cover}--><i class="Hui-iconfont" style="color:#5eb95e;">&#xe6a7;</i><!--{else}--><i class="Hui-iconfont" style="color:#f00;">&#xe6a6;</i><!--{/if}--></td>
							<td><!--{if $val.is_ui}-->
	                        <i class="Hui-iconfont" style="color:#5eb95e;">&#xe6a7;</i></i>
	                        <!--{else}-->
	                        <i class="Hui-iconfont" style="color:#f00;">&#xe6a6;</i></i>
	                        <!--{/if}--></td>
							<td><input type="text" value="<!--{$val.sortby}-->" name="sortby" style="width:40px;margin:0 auto;"/></td>
							<td><!--{$val.click_sum}--></td>
							<td><!--{$val.reward_sum}--></td>
							<td><!--{$val.author_name}--></td>
							<td><!--{if $val.is_audit==0}-->未审核
	                        <!--{else if $val.is_audit==1}-->通过
	                        <!--{else if $val.is_audit==2}-->驳回
	                        <!--{/if}--></td>
							<td><!--{if $val.audit_time}-->
	                        <!--{$val.audit_time|date_format:"Y-m-d H:i:s"}-->
	                        <!--{else}-->
	                        <!--{$val.create_time|date_format:"Y-m-d H:i:s"}-->
	                        <!--{/if}--></td>
							<td>表格内容</td>
						</tr>
						<!--{/foreach}-->
					</tbody>
				</table>
				<!--{$multi_url}-->
			</div>
		<!--{/if}-->
		
		<!--{if $op=='show_add'}-->
			<div class="codeView docs-example">
				<form method="post" class="form form-horizontal" id="demoform-2" novalidate="novalidate">
					<legend>带验证表单</legend>
					<div class="row cl">
						<label class="form-label col-xs-4 col-sm-3">邮箱：</label>
						<div class="formControls col-xs-8 col-sm-9">
							<input type="text" class="input-text" placeholder="@" name="email" id="email">
						</div>
					</div>
					<div class="row cl">
						<label class="form-label col-xs-4 col-sm-3">用户名：</label>
						<div class="formControls col-xs-8 col-sm-9">
							<input type="text" class="input-text" placeholder="4~16个字符，字母/中文/数字/下划线" name="username" id="username">
						</div>
					</div>
					<div class="row cl">
						<label class="form-label col-xs-4 col-sm-3">账户：</label>
						<div class="formControls col-xs-8 col-sm-9">
							<input type="text" class="input-text" autocomplete="off" placeholder="手机/邮箱" name="account" id="account">
						</div>
					</div>
					<div class="row cl">
						<label class="form-label col-xs-4 col-sm-3">密码：</label>
						<div class="formControls col-xs-8 col-sm-9">
							<input type="password" class="input-text" autocomplete="off" placeholder="密码" name="password" id="password">
						</div>
					</div>
					<div class="row cl">
						<label class="form-label col-xs-4 col-sm-3">密码验证：</label>
						<div class="formControls col-xs-8 col-sm-9">
							<input type="password" class="input-text" autocomplete="off" placeholder="密码" name="password2" id="password2">
						</div>
					</div>
					<div class="row cl">
						<label class="form-label col-xs-4 col-sm-3">网址：</label>
						<div class="formControls col-xs-8 col-sm-9">
							<input type="text" class="input-text" autocomplete="off" placeholder="http://" name="url" id="url">
						</div>
					</div>
					<div class="row cl">
						<label class="form-label col-xs-4 col-sm-3">单选框：</label>
						<div class="formControls skin-minimal col-xs-8 col-sm-9">
							<div class="radio-box">
								<input type="radio" id="sex-1" name="sex" value="1">
								<label for="sex-1" class="">男</label>
							</div>
							<div class="radio-box">
								<input type="radio" id="sex-2" name="sex" value="2">
								<label for="sex-2" class="">女</label>
							</div>
							<div class="radio-box">
								<input type="radio" id="sex-3" name="sex" value="0">
								<label for="sex-3" class="">保密</label>
							</div>
						</div>
					</div>
					<div class="row cl">
						<label class="form-label col-xs-4 col-sm-3">爱好：</label>
						<div class="formControls skin-minimal col-xs-8 col-sm-9">
							<div class="check-box">
								<input type="checkbox" id="aihao-5" name="aihao[]" value="1">
								<label for="checkbox-5" class="">上网</label>
							</div>
							<div class="check-box">
								<input type="checkbox" id="aihao-6" name="aihao[]" value="2">
								<label for="checkbox-6">摄影</label>
							</div>
						</div>
					</div>
					<div class="row cl">
						<label class="form-label col-xs-4 col-sm-3">附件：</label>
						<div class="formControls col-xs-8 col-sm-9"> <span class="btn-upload form-group">
							<input class="input-text upload-url" type="text" name="uploadfile1" id="uploadfile1" readonly="" style="width:200px">
							<a href="javascript:void();" class="btn btn-primary upload-btn"><i class="Hui-iconfont"></i> 浏览文件</a>
							<input type="file" multiple="" name="file-2" class="input-file">
							</span> </div>
					</div>
					<div class="row cl">
						<label class="form-label col-xs-4 col-sm-3">所在城市：</label>
						<div class="formControls col-xs-8 col-sm-9"> <span class="select-box">
							<select class="select" size="1" name="city">
								<option value="" selected="">请选择城市</option>
								<option value="1">北京</option>
								<option value="2">上海</option>
								<option value="3">广州</option>
							</select>
							</span> </div>
					</div>
					<div class="row cl">
						<label class="form-label col-xs-4 col-sm-3">备注：</label>
						<div class="formControls col-xs-8 col-sm-9">
							<textarea class="textarea" placeholder="说点什么...最少输入10个字符" name="beizhu"></textarea>
							<p class="textarea-numberbar"><em class="textarea-length">0</em>/500</p>
						</div>
					</div>
					<div class="row cl">
						<div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-3">
							<input class="btn btn-primary" type="submit" id="btn-on" value="&nbsp;&nbsp;提 交&nbsp;&nbsp;">
						</div>
					</div>
				</form>
			</div>
		<!--{/if}-->

		<!--{if $op=='edit'}-->
		
		<!--{/if}-->



		</article>	
	</div>
</section>
<!--/请在上方写此页面业务相关的脚本-->
<script type="text/javascript">
$(function(){
	$('.skin-minimal input').iCheck({
		checkboxClass: 'icheckbox-blue',
		radioClass: 'iradio-blue',
		increaseArea: '20%'
	});

	$("#demoform-2").validate({
		rules:{
			email:{
				required:true,
				email:true,
			},
			username:{
				required:true,
				minlength:4,
				maxlength:16
			},
			account:{
				required:true,
			},
			password:{
				required:true,
			},
			password2:{
				required:true,
				equalTo: "#password"
			},
			url:{
				required:true,
				url:true,
			},
			sex:{
				required:true,
			},
			aihao:{
				required:true,
			},
			fujian:{
				required:true,
			},
			city:{
				required:true,
			},
			url:{
				required:true,
				url:true
			},
			beizhu:{
				required:true,
			},
		},
		onkeyup:false,
		focusCleanup:true,
		success:"valid",
		submitHandler:function(form){
			$(form).ajaxSubmit({
				url:'/admht.php?tp=news&op=do_add',
				type:'post',
				dataType:'json',
				beforeSend: function(){
			    	$('#btn-on').addClass('disabled');
			    },
				success:function(json){
					if (json.status ==1) {
						layer.msg(json.msg);
						setTimeout("window.location.href='"+json.data.url+"'",1000);
					}else{
						layer.msg(json.msg);
					}
					$('#btn-on').removeClass('disabled');
				},
				complete: function(){
					
				}
			});
		}
	});
});
</script>
<!--_footer 作为公共模版分离出去-->
<!--{include file="admht/_footer.html"}-->
